import { create } from 'zustand';
import { devtools } from 'zustand/middleware';

interface AppState {
  loading: boolean;
  setLoading: (loading: boolean) => void;
  breadcrumbs: string[];
  setBreadcrumbs: (breadcrumbs: string[]) => void;
  notifications: number;
  setNotifications: (count: number) => void;
}

export const useAppStore = create<AppState>()(
  devtools(
    (set) => ({
      loading: false,
      setLoading: (loading) => set({ loading }),
      breadcrumbs: [],
      setBreadcrumbs: (breadcrumbs) => set({ breadcrumbs }),
      notifications: 0,
      setNotifications: (notifications) => set({ notifications }),
    }),
    {
      name: 'app-store',
    }
  )
);